home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / enigma / earcd / utility / utilcli / execthck.rdm < prev    next >
Text File  |  1997-01-18  |  2KB  |  62 lines

  1. Short:    V1.3 Hack to make Execute recognize #!
  2. Author:   pueschel@imsdd.meb.uni-bonn.de
  3. Uploader: pueschel@imsdd.meb.uni-bonn.de
  4. Type:     util/cli
  5.  
  6. The Execute Hack:
  7.  
  8. This is a little hack that makes the execute command recognize
  9. the #! convention in script files. This means: if a script file
  10. starts with, say "#!/bin/sh", as the first line, my Execute
  11. will run sh as an interpreter on the file. All you have to do
  12. is set the s-flag on the script, and it can be used like other
  13. Amiga-OS scripts.
  14.  
  15. Installation:
  16.  
  17. Rename c:Execute to C:Execute.orig (it is called by my Execute for
  18. amiga shell scripts).
  19. Copy my Execute to c: (it can be made resident, like the original).
  20. That's all :-)
  21.  
  22. Use:
  23.  
  24. Set the s-flag on all sh, csh, perl or whatever-you-use scripts.
  25. That's it. You do not even need to change the paths in the script
  26. files:
  27.  
  28. #!/usr/bin/perl
  29. #!/usr/local/bin/perl
  30. #!/foo/bar/perl
  31. #! perl
  32.  
  33. are all equivalent. My execute strips the path from the interpreter
  34. name and searches the resident list and the Amiga-OS path for the
  35. command.
  36.  
  37. The complete invocation (e.g. perl -i blabla) is set as CLI command
  38. name.
  39.  
  40. Problems & History:
  41.  
  42. The original Execute apparently does not use ReadArgs(), so my Execute
  43. does not react exactly the same way when an error occurs.
  44.  
  45. The first release did not search for scripts, like the original Execute
  46. does. Fixed.
  47.  
  48. The last component of the search path was ignored. Fixed. Thanks to Gunther
  49. Nikl for the report.
  50.  
  51. AmigaDOS style paths in the #! line, like #!bin:sh, did not work. Fixed.
  52.  
  53. Spaces between #! and interpreter name were not properly ignored. Fixed.
  54.  
  55. Legal Stuff:
  56.  
  57. There is no warranty. The program is Freeware.
  58.  
  59. Bug reports & suggestions:
  60.  
  61. Send bug reports & suggestions to pueschel@imsdd.meb.uni-bonn.de.
  62.